package com.endurance.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @ProjectName: spring-cloud-hoxton-parent
 * @Package: com.endurance.config
 * @ClassName: RestTemplateConfig
 * @Description:
 * @Author: sunlin
 * @CreateDate: 2024/02/05 09:16
 * @Version: 1.0
 */
@Configuration
public class RestTemplateConfig {

    @Bean
    @LoadBalanced // 代表当前创建的对象，不是一个单纯的http客户端对象，这个http客户端对象具有负载均衡的功能
    public RestTemplate restTemplate() {
         return new RestTemplate();
    }

}
